<template>
    <div>
        <h1>{{ count }}</h1>
      <button @click="handleClick">点击我</button>
      <p v-if="clickInfo">你点击的位置是 X: {{ clickInfo.x }}, Y: {{ clickInfo.y }}</p>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  
  // 存储点击信息的响应式变量
  const clickInfo = ref(null);
  const count=ref(0);
  // 处理点击事件的函数
  const handleClick = (event) => {
    count.value ++
    clickInfo.value = {
      x: event.clientX,
      y: event.clientY
    };
  };
  </script>